import os

from dotenv import load_dotenv
from langchain.chat_models import init_chat_model
from langchain_core.output_parsers import StrOutputParser

if __name__ == '__main__':
    load_dotenv(override=True)
    DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY")
    model = init_chat_model(model="deepseek-chat", model_provider="deepseek")
    question = "你好，请介绍一下你自己"
    basic_qa_chain = model | StrOutputParser()
    result = basic_qa_chain.invoke(question)
    print(result)
